home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Apple II / System 6.0 Sample Code / CDevTester / CDevTester.r < prev    next >
Encoding:
Text File  |  1993-06-15  |  15.9 KB  |  461 lines  |  [TEXT/MPS ]

  1. /************************************************************/
  2. /*                                                            */
  3. /*    File:            CDEVTester.r                            */
  4. /*    Version:        1.0                                        */
  5. /*    Author:            Bob Haven                                */
  6. /*    Copyright:        (c) 1991 by Apple Computer, Inc.        */
  7. /*                                                            */
  8. /*    Description:    This file contains the resource            */
  9. /*                    definitions used by the CDEVTester        */
  10. /*                    CDEV. This CDEV was created from        */
  11. /*                    Greg Branch's Folder Privilages            */
  12. /*                    CDEV code.                                */
  13. /*                                                            */
  14. /************************************************************/
  15.  
  16. #include "TypesIIGS.r"    //    include the type definitions
  17. #include "rDefs.h"        //    include defines
  18.  
  19. /************************************************************/
  20. /*        Read the resources built elsewhere                    */
  21. /************************************************************/
  22.  
  23. read rCDEVCode (1, Convert) "FP.Code";    // this is the code resource
  24.  
  25. /************************************************************/
  26. /*        Define a couple of resourses for file info            */
  27. /************************************************************/
  28.  
  29. resource rVersion (1) {
  30.     {1,0,0,alpha,1},
  31.     verUS,
  32.     "CDEVTester",
  33.     "Copyright 1989-91, Apple Computer, Inc."
  34.     };
  35.  
  36. resource rComment (1) {
  37. "The CDEVTester tests most of the messages passed by the Control Panel to the "
  38. "the CDEVTester. The messages are passed if the their appropriate bit has been "
  39. "set in CDEV's rCDEVFlags resource. The only unsupported message is the ShutDownCDEV "
  40. "message."
  41. };
  42.  
  43.  
  44. /************************************************************/
  45. /*        Define our resources                                */
  46. /************************************************************/
  47.  
  48. resource rCDEVFlags (1) {
  49.     wantMachine +            /* this flag is currently not used */
  50.     wantBoot +
  51. /*    wantShutDown +    */        /* this flag is currently not used */
  52.     wantInit +
  53.     wantClose +
  54.     wantEvents +
  55.     wantCreate +
  56.     wantAbout +
  57.     wantRect +
  58.     wantHit +
  59.     wantRun +
  60.     wantEdit +
  61. /*    wantReserved2 +    */        /* this flag is currently not used */
  62. /*    wantReserved2 +    */        /* this flag is currently not used */
  63. /*    updateSSfromBRAM +    */    /* this flag is used by Apple Only!!! */
  64.     CanBeInActive,                            /*    CDEV flags    */
  65.     1,                                        //    enabled = True
  66.     1,                                        //    Version = 1
  67.     1,                                        //    Machine = v1 ROMs or higher
  68.     6,                                        //    System = v6.0 or higher
  69.     {0,0,175,200},                            //    DataRect - top left MUST be 0,0
  70.     "CDEVTester",                            //    Name
  71.     "Bob Haven",                            //    Author
  72.     "v1.0a1";                                //    Version String
  73. };
  74.  
  75. /************************************************************/
  76. /*        Define About Box resources                            */
  77. /************************************************************/
  78.  
  79. resource rControlTemplate (AboutID) {
  80.     AboutID,                                //    control ID
  81.     {35,0,140,295},                            //    rect
  82.     editTextControl {{
  83.         0b0000000000000000,                    //    flags
  84.         0b0111010000001111,                    //    more flags
  85.         0,                                    //    refCon
  86.         0b01000100100100000000000000000000,    //    text flags
  87.         {0xFFFF,0xFFFF,0xFFFF,0xFFFF},        //    indent rect
  88.         0xFFFFFFFF,                            //    vert scroll bar
  89.         0x0000,                                //    vert scroll amount
  90.         0,                                    //    horiz scroll bar
  91.         0,                                    //    horiz scroll amount
  92.         0,                                    //    style ref
  93.         0b0000000000010101,                    //    text descriptor
  94.         AboutText,                            //    text ref
  95.         0                                    //    text length
  96.     }},
  97. };
  98.  
  99. resource rText (AboutText) {
  100.     "This CDEV tests all messages that can be passed by a CDEV. "
  101.     "Some of the code for this CDEV was borrowed from the 'Folder "
  102.     "Privileges' CDEV written by Greg Branche. I would like to thank:\n\n"
  103.     "Greg Branche - for borrowing his code.\n\n"
  104.     "Anil Gursahani - for helping implement the time updating routine.\n\n"
  105.     "Ben Koning - for writing the assembly routine for matching the system copy of "
  106.     "BRAM parameters to the actual BRAM parameters.\n\n"
  107.     "Andy Nicholas - for general debugging help.\n\n"
  108.     "Dave Lyons - for reminding me not to call FrontWindow from my CDEV.\n\n"
  109.     "Jumpin Johnny - for having me write this thing in the first place.\n\n"
  110.     "The LeMonster  - for being such a nice guy.\n\n"
  111.     "And Margarita Sang - for finding my Bonehead mistakes.\n\n"
  112.     "This CDEV should work on any IIGS ROM 01 or O3 machine running System "
  113.     "Software V5.0 or greater.\n\n"
  114.     "The following are the messages that can be passed and what "
  115.     "to look for to verify that these messages are being passed "
  116.     "and handled properly: \n\n"
  117.     "MachineCDEV:\n"
  118.     "An MachineCDEV AlertWindow will be displayed before opening the CDEV.\n\n"
  119.     "BootCDEV:\n"
  120.     "The icon in this AboutBox will be displayed at boot time.\n\n"
  121.     "InitCDEV:\n"
  122.     "An InitCDEV AlertWindow will be displayed before opening the CDEV informing "
  123.     "the user that some of the CDEV's controls have been deactivated.\n\n"
  124.     "CloseCDEV:\n"
  125.     "A CloseCDEV AlertWindow will be displayed when CDEV is closed.\n\n"
  126.     "EventsCDEV:\n"
  127.     "Select the checkbox of the event you want to post then create the event. "
  128.     "An AlertWindow will be displayed after the event is created.  Clearing the "
  129.     "AlertWindow will reset the checkboxes. The checkboxes of upsupported events "
  130.     "have been dimmed by the InitCDEV proc.\n\n"
  131.     "Null Event - Not supported.\n\n"
  132.     "MouseDown Event - AlertWindow; click anywhere on the CDEV window.\n\n"
  133.     "MouseUp Event - AlertWindow; click anywhere on the desktop.\n\n"
  134.     "KeyDown Event - AlertWindow; press any key without the caps lock down (including "
  135.     "modifiers).\n\n"
  136.     "AutoKey Event - AlertWindow; hold any key down without the caps lock down "
  137.     "(inclding modifiers).\n\n"
  138.     "Update Event - AlertWindow; move another window over the CDEV window and then off "
  139.     "or move part of the CDEV window off screen and then back.\n\n"
  140.     "Activate Event - AlertWindow; click on another window and then on the CDEV window.\n\n"
  141.     "Switch Event - Not supported.\n\n"
  142.     "DeskAccessory Event - The Desk Manager intercepts this event.\n\n"
  143.     "Driver Event - Not supported.\n\n"
  144.     "Application Event - Not supported.\n\n"
  145.     "CreateCDEV:\n"
  146.     "The CDEV controls drawn properly verify this message.\n\n"
  147.     "AboutCDEV:\n"
  148.     "The About Box controls drawn properly verify this message.\n\n"
  149.     "RectCDEV:\n"
  150.     "An AlertWindow is displayed informing you that the CDEV window is being resized.\n\n"
  151.     "HitCDEV:\n"
  152.     "AlertWindow; click on the 'ASCII Time' or 'Check A Box' StaticTextControl.\n\n"
  153.     "RunCDEV:\n"
  154.     "Updating of the ASCII Time will verify this message.\n\n"
  155.     "EditCDEV:\n"
  156.     "AlertWindow; select one of the following from the Edit Menu (Undo, Cut, Copy, Paste, "
  157.     "or Clear)."
  158. };
  159.  
  160. /************************************************************/
  161. /*        Define Control resources                            */
  162. /************************************************************/
  163.  
  164. //----------------------------------------------------------------------------------
  165. // Control List
  166.  
  167. resource rControlList (myCtrlList) {{
  168.     CheckABoxText,                            /* control resource id for CheckABoxText StatText control */
  169.     NullEventCheckBox,                        /* control resource id for NullEventCheckBox control */
  170.     MouseDownEventCheckBox,                    /* control resource id for MouseDownEventCheckBox control */
  171.     MouseUpEventCheckBox,                    /* control resource id for MouseUpEventCheckBox control */
  172.     KeyDownEventCheckBox,                    /* control resource id for KeyDownEventCheckBox control */
  173.     AutoKeyEventCheckBox,                    /* control resource id for AutoKeyEventCheckBox control */
  174.     UpdateEventCheckBox,                    /* control resource id for UpdateEventCheckBox control */
  175.     ActivateEventCheckBox,                    /* control resource id for ActivateEventCheckBox control */
  176.     SwitchEventCheckBox,                    /* control resource id for ActivateEventCheckBox control */
  177.     DeskAccEventCheckBox,                    /* control resource id for DeskAccEventCheckBox control */
  178.     DriverEventCheckBox,                    /* control resource id for DriverEventCheckBox control */
  179.     ASCIITimeStaticText                        /* control resource id for ASCIITimeStaticText StatText control */
  180.     };};
  181.  
  182. //----------------------------------------------------------------------------------
  183. //  CheckABoxText StaticText control
  184.  
  185. resource rControlTemplate (CheckABoxText) {
  186.     CheckABoxText,                          /* control id */ 
  187.     {5,10,15,180},                          /* control rectangle */
  188.     statTextControl{{                          /* control type */
  189.         0x0000,                              /* flags */
  190.         0x1002,                              /* more flags */
  191.         0,                                    /* ref con */
  192.         CheckABoxText,                   /* text reference */
  193.         0x0000,                               /* text length */
  194.         0x0001                                /* text justification */
  195.     }};
  196. };
  197.  
  198. resource rTextForLETextBox2 (CheckABoxText) {
  199.     "Check A Box"
  200. };
  201.  
  202. //----------------------------------------------------------------------------------
  203. // NullEventCheckBox control
  204.  
  205. resource rControlTemplate (NullEventCheckBox) {
  206.     NullEventCheckBox,                      /* control id */ 
  207.     {15,10,25,180},                            /* control rectangle */
  208.     CheckControl{{                          /* control type */
  209.         0x0001,                              /* flags */
  210.         0x1002,                              /* more flags */
  211.         0,                                    /* ref con */
  212.         NullEventCheckBox,                   /* title reference */
  213.         0x0000                                 /* inital value */
  214.     }};
  215. };
  216.  
  217. resource rPString (NullEventCheckBox) { 
  218.     "Null Event Flag"
  219. };
  220.  
  221. //----------------------------------------------------------------------------------
  222. // MouseDownEventCheckBox control
  223.  
  224. resource rControlTemplate (MouseDownEventCheckBox) {
  225.     MouseDownEventCheckBox,                  /* control id */ 
  226.     {25,10,35,180},                            /* control rectangle */
  227.     CheckControl{{                          /* control type */
  228.         0x0001,                              /* flags */
  229.         0x1002,                              /* more flags */
  230.         0,                                    /* ref con */
  231.         MouseDownEventCheckBox,               /* title reference */
  232.         0x0000                                 /* inital value */
  233.     }};
  234. };
  235.  
  236. resource rPString (MouseDownEventCheckBox) { 
  237.     "MouseDown Event Flag"
  238. };
  239.  
  240. //----------------------------------------------------------------------------------
  241. // MouseUpEventCheckBox control
  242.  
  243. resource rControlTemplate (MouseUpEventCheckBox) {
  244.     MouseUpEventCheckBox,                      /* control id */ 
  245.     {35,10,45,180},                            /* control rectangle */
  246.     CheckControl{{                          /* control type */
  247.         0x0001,                              /* flags */
  248.         0x1002,                              /* more flags */
  249.         0,                                    /* ref con */
  250.         MouseUpEventCheckBox,               /* title reference */
  251.         0x0000                                 /* inital value */
  252.     }};
  253. };
  254.  
  255. resource rPString (MouseUpEventCheckBox) { 
  256.     "MouseUp Event Flag"
  257. };
  258.  
  259. //----------------------------------------------------------------------------------
  260. // KeyDownEventCheckBox control
  261.  
  262. resource rControlTemplate (KeyDownEventCheckBox) {
  263.     KeyDownEventCheckBox,                      /* control id */ 
  264.     {45,10,55,180},                            /* control rectangle */
  265.     CheckControl{{                          /* control type */
  266.         0x0001,                              /* flags */
  267.         0x1002,                              /* more flags */
  268.         0,                                    /* ref con */
  269.         KeyDownEventCheckBox,               /* title reference */
  270.         0x0000                                 /* inital value */
  271.     }};
  272. };
  273.  
  274. resource rPString (KeyDownEventCheckBox) { 
  275.     "KeyDown Event Flag"
  276. };
  277.  
  278. //----------------------------------------------------------------------------------
  279. // AutoKeyEventCheckBox control
  280.  
  281. resource rControlTemplate (AutoKeyEventCheckBox) {
  282.     AutoKeyEventCheckBox,                      /* control id */ 
  283.     {55,10,65,180},                            /* control rectangle */
  284.     CheckControl{{                          /* control type */
  285.         0x0001,                              /* flags */
  286.         0x1002,                              /* more flags */
  287.         0,                                    /* ref con */
  288.         AutoKeyEventCheckBox,               /* title reference */
  289.         0x0000                                 /* inital value */
  290.     }};
  291. };
  292.  
  293. resource rPString (AutoKeyEventCheckBox) { 
  294.     "AutoKey Event Flag"
  295. };
  296.  
  297. //----------------------------------------------------------------------------------
  298. // UpdateEventCheckBox control
  299.  
  300. resource rControlTemplate (UpdateEventCheckBox) {
  301.     UpdateEventCheckBox,                      /* control id */ 
  302.     {65,10,75,180},                            /* control rectangle */
  303.     CheckControl{{                          /* control type */
  304.         0x0001,                              /* flags */
  305.         0x1002,                              /* more flags */
  306.         0,                                    /* ref con */
  307.         UpdateEventCheckBox,                   /* title reference */
  308.         0x0000                                 /* inital value */
  309.     }};
  310. };
  311.  
  312. resource rPString (UpdateEventCheckBox) { 
  313.     "Update Event Flag"
  314. };
  315.  
  316. //----------------------------------------------------------------------------------
  317. // ActivateEventCheckBox control
  318.  
  319. resource rControlTemplate (ActivateEventCheckBox) {
  320.     ActivateEventCheckBox,                  /* control id */ 
  321.     {75,10,85,180},                            /* control rectangle */
  322.     CheckControl{{                          /* control type */
  323.         0x0001,                              /* flags */
  324.         0x1002,                              /* more flags */
  325.         0,                                    /* ref con */
  326.         ActivateEventCheckBox,               /* title reference */
  327.         0x0000                                 /* inital value */
  328.     }};
  329. };
  330.  
  331. resource rPString (ActivateEventCheckBox) { 
  332.     "Activate Event Flag"
  333. };
  334.  
  335. //----------------------------------------------------------------------------------
  336. // SwitchEventCheckBox control
  337.  
  338. resource rControlTemplate (SwitchEventCheckBox) {
  339.     SwitchEventCheckBox,                      /* control id */ 
  340.     {85,10,95,180},                        /* control rectangle */
  341.     CheckControl{{                          /* control type */
  342.         0x0001,                              /* flags */
  343.         0x1002,                              /* more flags */
  344.         0,                                    /* ref con */
  345.         SwitchEventCheckBox,                   /* title reference */
  346.         0x0000                                 /* inital value */
  347.     }};
  348. };
  349.  
  350. resource rPString (SwitchEventCheckBox) { 
  351.     "Switch Event Flag"
  352. };
  353.  
  354. //----------------------------------------------------------------------------------
  355. // DeskAccEventCheckBox control
  356.  
  357. resource rControlTemplate (DeskAccEventCheckBox) {
  358.     DeskAccEventCheckBox,                      /* control id */ 
  359.     {95,10,105,180},                            /* control rectangle */
  360.     CheckControl{{                          /* control type */
  361.         0x0001,                              /* flags */
  362.         0x1002,                              /* more flags */
  363.         0,                                    /* ref con */
  364.         DeskAccEventCheckBox,               /* title reference */
  365.         0x0000                                 /* inital value */
  366.     }};
  367. };
  368.  
  369. resource rPString (DeskAccEventCheckBox) { 
  370.     "DeskAcc Event Flag"
  371. };
  372.  
  373. //----------------------------------------------------------------------------------
  374. // DriverEventCheckBox control
  375.  
  376. resource rControlTemplate (DriverEventCheckBox) {
  377.     DriverEventCheckBox,                      /* control id */ 
  378.     {105,10,115,180},                        /* control rectangle */
  379.     CheckControl{{                          /* control type */
  380.         0x0001,                              /* flags */
  381.         0x1002,                              /* more flags */
  382.         0,                                    /* ref con */
  383.         DriverEventCheckBox,                   /* title reference */
  384.         0x0000                                 /* inital value */
  385.     }};
  386. };
  387.  
  388. resource rPString (DriverEventCheckBox) { 
  389.     "Driver Event Flag"
  390. };
  391.  
  392. //----------------------------------------------------------------------------------
  393. //  ASCII Time StaticText control
  394.  
  395. resource rControlTemplate (ASCIITimeStaticText) {
  396.     ASCIITimeStaticText,                      /* control id */ 
  397.     {120,16,130,175},                          /* control rectangle */
  398.     statTextControl{{                          /* control type */
  399.         0x0000,                              /* flags */
  400.         0x1002,                              /* more flags */
  401.         0,                                    /* ref con */
  402.         ASCIITimeStaticText,                   /* text reference */
  403.         0x0000,                               /* text length */
  404.         0x0001                                /* text justification */
  405.     }};
  406. };
  407.  
  408. resource rTextForLETextBox2 (ASCIITimeStaticText) {
  409.     "ASCII Time"
  410. };
  411.  
  412. //###########################################################
  413. //#        Define icon resource                                #
  414. //###########################################################
  415.  
  416. resource rIcon (1) {                //    the "CDEV" icon
  417.     0x8000,                            //    kind
  418.     20,                                //    height
  419.     28,                                //    width
  420.     $"FFFFFFFFFFFFF00FFFFFFFFFFFFF"
  421.     $"FFFFFFFFFFFF0ee0FFFFFFFFFFFF"
  422.     $"FFFFFFFFFFF0eeee0FFFFFFFFFFF"
  423.     $"FFFFFFFFFFF0eeee0FFFFFFFFFFF"
  424.     $"FFFFFFFFFFF0e00e0FFFFFFFFFFF"
  425.     $"FFFFFFFFFF00e00e00FFFFFFFFFF"
  426.     $"FFFFFFFFFF00e00e00FFFFFFFFFF"
  427.     $"FFFFFFFFF000eeee000FFFFFFFFF"
  428.     $"FFFFFF0eee00eeee00eee0FFFFFF"
  429.     $"0FFF0eeeeee0eeee0eeeeee0FFF0"
  430.     $"0F0eeeeeeeee0ee0eeeeeeeee0F0"
  431.     $"00eeeeeeeee0eeee0eeeeeeeee00"
  432.     $"0F0eeeeeeee0eeee0eeeeeeee0F0"
  433.     $"0FF0000000F0eeee0F0000000FF0"
  434.     $"FFFFFFFFFFF0eeee0FFFFFFFFFFF"
  435.     $"FFFFFFFFFFF0eeee0FFFFFFFFFFF"
  436.     $"FFFFFFFFFF0ee00ee0FFFFFFFFFF"
  437.     $"FFFFFFFF0eeee00eeee0FFFFFFFF"
  438.     $"FFFFFF0eeeeee00eeeeee0FFFFFF"
  439.     $"FFFFFFF00000F00F00000FFFFFFF",
  440.  
  441.     $"0000000000000FF0000000000000"
  442.     $"000000000000FFFF000000000000"
  443.     $"00000000000FFFFFF00000000000"
  444.     $"00000000000FFFFFF00000000000"
  445.     $"00000000000FFFFFF00000000000"
  446.     $"0000000000FFFFFFFF0000000000"
  447.     $"0000000000FFFFFFFF0000000000"
  448.     $"000000000FFFFFFFFFF000000000"
  449.     $"F00000FFFFFFFFFFFFFFFF00000F"
  450.     $"F000FFFFFFFFFFFFFFFFFFFF000F"
  451.     $"F0FFFFFFFFFFFFFFFFFFFFFFFF0F"
  452.     $"FFFFFFFFFFFFFFFFFFFFFFFFFFFF"
  453.     $"F0FFFFFFFFFFFFFFFFFFFFFFFF0F"
  454.     $"F00FFFFFFFFFFFFFFFFFFFFFF00F"
  455.     $"00000000000FFFFFF00000000000"
  456.     $"00000000000FFFFFF00000000000"
  457.     $"0000000000FFFFFFFF0000000000"
  458.     $"00000000FFFFFFFFFFFF00000000"
  459.     $"000000FFFFFFFFFFFFFFFF000000"
  460.     $"0000000FFFFFFFFFFFFFF0000000"
  461. };